package com.liao.badminton.code;

public class PageParam<T> {
    private static final long serialVersionUID = 1L;

    /**
     * 每页显示条数，默认 10
     */
    private int size = 10;

    /**
     * 当前页
     */
    private int current = 1;
    private T args;

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getCurrent() {
        return current < 1 ? 1 : current;
    }

    public void setCurrent(int current) {
        if (current == 0) {
            current = 1;
        }
        this.current = current;
    }

    public T getArgs() {
        return args;
    }

    public void setArgs(T args) {
        this.args = args;
    }

    public Integer getStart() {
        return (current - 1) * size;
    }
}
